#include <iostream>

class MyNumber
{

public:
    static int a;
    const static int b;
    // static 属性，需要在类内定义，类外赋值
    static void sample();
};

int MyNumber::a = 10;
const int MyNumber::b = 100; // 在类外赋值时不写static，但要写const

void MyNumber::sample() {
    std::cout << "sample() out" << std::endl;
}

int main(int argc, char const *argv[])
{
    std::cout << MyNumber::a << std::endl;

    MyNumber a;
    a.sample();
    MyNumber::sample();
    return 0;
}
